package com.icxx.learn.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * The type Hello world controller.
 *
 * @author icxx
 * @version 1.0
 * @date 2019 -02-17 11:48:24
 */
@RestController
public class HelloWorldController {
    /**
     * The Port.
     */
    @Value("${server.port}")
    String port;

    /**
     * Home string.
     *
     * @param name
     * @return the string
     */
    @RequestMapping("/hello")
    public String home(@RequestParam(value = "name", defaultValue = "icxx") String name) {
        return "hello " + name + " ,i am from port:" + port;
    }
}
